home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / dev / c / c_v43_dt.rea < prev    next >
Text File  |  1997-05-03  |  8KB  |  183 lines

  1. Short:    How: OS3 V40/43 PicDatatype in 100% C
  2. Author:   Andreas_Kleinert@t-online.de
  3. Uploader: Andreas_Kleinert@t-online.de
  4. Type:     dev/c
  5.  
  6.  
  7.   samplePNM.datatype and source-code V43.6 (27.3.97)
  8.   (C) 1996-97 by Andreas R. Kleinert. All rights reserved.
  9.  
  10.   ---
  11.   This small sample datatype source code demonstrates, how to completely
  12.   write an Amiga OS 3 datatype (V40/V43) without any assembler stubs
  13.   or compiler/linker tricks in PURE C source code (currently SAS/C-based:
  14.   see Aminet:dev/c/CLib37x.LHA on how to adjust for some other compilers).
  15.  
  16.   You may e.g. use this example source code to write more portable
  17.   Amiga OS 3 datatypes to allow easier porting of these
  18.   to other Amiga OS-derived operating systems, or the native
  19.   OS of an upcoming PowerPC Amiga.
  20.  
  21.   Translate your 68k-assembler datatype startup-codes smartly
  22.   to C by simply using this source-code as an advice how to do it.
  23.  
  24.  
  25.   As a common case, a datatype of class picture, supporting
  26.   PNM-PGM (P5) and PNM-PPM (P6) has been used as an example.
  27.  
  28.   With picture.datatype V40-42 only PGM is supported,
  29.   and with picture.datatype V43 reading of PPM is offered as well,
  30.   while encountering an PGM file under V43 causes a fallback to V40
  31.   routines (could have been done differently, but was not necessary
  32.   here just for demonstration).
  33.  
  34.   For testing this datatype, simply use a tool from the NetPBM package
  35.   (or maybe for example a tool supporting superview.library) and save
  36.   a graphics in the binary PGM or PPM format (P5/P6 of the PNM series).
  37.  
  38.   Then install this datatype and try loading the file via MultiView.
  39.   Should work fine.
  40.  
  41.   ---
  42.   Feel free to use this source for own projects.
  43.  
  44.   It is allowed to be spread and distributed anywhere, as far
  45.   as my consent is concerned.
  46.  
  47.   Amiga Technologies, or the current owner of the technologie,
  48.   is allowed to always put this source on their newest
  49.   Developer CD-ROM.
  50.  
  51.   Thanks and credits will always be appreciated - for example,
  52.   you MAY, but NEED NOT:
  53.   give me credits in your program's docs, send me keyfiles for
  54.   your programs using the library, and so on.
  55.   But that's simply voluntarily.
  56.  
  57.   This work was only roughly inspired by David Junod's original
  58.   example source codes for datatypes.
  59.  
  60.    _________________________________________________________
  61.   |      You may reach me the following way.                |
  62.   |    Send bug-reports, money or whatever to:              |
  63.   |---------------------------------------------------------|
  64.   |        * SuperView Development & Registration *         |
  65.   |          * DRAFU Development & Registration *           |
  66.   |       * Image Engineer Registration Site Europe *       |
  67.   |                                                         |
  68.   |                                                         |
  69.   |                  PerSuaSiVe SoftWorX                    |
  70.   |                                                         |
  71.   |                  Andreas R. Kleinert                    |
  72.   |                  Sandstrasse 1                          |
  73.   |                  D-57072 Siegen                         |
  74.   |                  Germany, Europe                        |
  75.   |                                                         |
  76.   | Any snail mail to the old address will still be routed. |
  77.   |                                                         |
  78.   |                  Phone:  +49-271-22869 also FAX + AM    |
  79.   |                          +49-271-22838                  |
  80.   |                                                         |
  81.   |                  Weekdays after 17.00h.                 |
  82.   |                                                         |
  83.   |         When calling via phone you may leave a message, |
  84.   |         if I'm not available - but don't expect me      |
  85.   |         calling back to USA, Australia, ... since       |
  86.   |         german phone rates are HIGHLY expensive.        |
  87.   |_________________________________________________________|
  88.  
  89.     http://home.t-online.de/home/Andreas_Kleinert/
  90.  
  91.   eMail:
  92.  
  93.         Please send binaries via ARK@COB.wwbnet.de, and keep
  94.         them smaller than 16 KB. Please think twice before
  95.         sending them - my postbox is not unlimited in size.
  96.  
  97.            - Fido    Andreas Kleinert 2:2457/350.18
  98.            - Usenet
  99.                      Andreas_Kleinert@ftn.neckar-alb.de      (Fido-Gate)
  100.                      Andreas_Kleinert@t-online.de            (T-Online)
  101.                      ARK@COB.wwbnet.de                       (Z-Netz)
  102.                      ARK@amigaworld.com                      (AmigaWorld)
  103.  
  104.            - If nothing else works, try one of these public
  105.              Fido-Usenet gateways:
  106.  
  107.                In Germany:
  108.                  Andreas_Kleinert@p18.f350.n2457.z2.fido.sub.org
  109.  
  110.                From USA or elsewhere:
  111.                  Andreas_Kleinert@p18.f350.n2457.z2.fidonet.org
  112.  
  113.         Please note, that the "superview.ftn.sub.org"
  114.         domain will perhaps be renamed soon
  115.  
  116.  History:
  117.  
  118.  V43.6 (27.3.97) :  - did some finetuning
  119.                     - now can simply be turned into a V40 datatype
  120.                       by removing a #define (and/or the corresponding
  121.                       parts of the code)
  122.  
  123.  V43.5 (25.1.97) :  - now explicitely checks for DTA_SourceType == DTST_File
  124.                     - small changes
  125.                     - updated email information
  126.  
  127.  V43.4 (3.1.97) :   - fixed PRI entry in resident part
  128.                     - slightly changed SCOPTIONS
  129.                     - fixed some style things (APTR and library casts)
  130.                     - fixed a bug: bitmap would not have been freed
  131.                       on temporary-buffer allocation error
  132.                     - added note about library opening to L_OpenLibs()
  133.  
  134.  V43.3 (30.11.96) : - added SAS/C specific Ctrl-C disabling code
  135.                     - made some workarounds compiler sensitive
  136.                     - redone all with SAS/C V6.57
  137.  
  138.  V43.2 (3.11.96)  : - there was a FreeBitMap() call missing (oops)
  139.                     - it's samplePNM.dt, not samplePNG.dt ;-)
  140.  
  141.  V43.1 (25.10.96) : - added picture datatype V43 support
  142.                     - thus added support for 24 Bit PPM (P6),
  143.                       since PGM only has 256 grayscales
  144.                     - thus renamed to samplePNM.datatype
  145.  
  146.  V40.3 (13.9.96)  : - fixed more "style" things
  147.  
  148.  V40.2 (5.9.96)   : - fixed some "style" things
  149.  
  150.  V40.1 (2.9.96)   : - first release
  151.  
  152.  ---
  153.  All mentioned trademarks are subjects to their owners.
  154.  
  155.  
  156. ============================= Archive contents =============================
  157.  
  158. Original  Packed Ratio    Date     Time    Name
  159. -------- ------- ----- --------- --------  -------------
  160.       86      76 11.6% 25-Oct-96 16:26:52 +PGM
  161.      467     279 40.2% 25-Oct-96 16:26:52 +PGM.info
  162.       86      76 11.6% 25-Oct-96 16:27:44 +PPM
  163.      467     279 40.2% 25-Oct-96 16:27:44 +PPM.info
  164.      107     102  4.6% 25-Oct-96 17:34:40 +CompileNote.readme
  165.      739     301 59.2% 25-Oct-96 16:17:50 +libfuncs.h
  166.      835     388 53.5% 25-Oct-96 16:28:52 +samplePNM.datatype.info
  167.      408     156 61.7% 25-Oct-96 16:23:58 +smakefile
  168.      119     104 12.6% 25-Oct-96 16:23:58 +smakefile.wth
  169.      795     364 54.2% 03-Jan-97 15:21:22 +classbase.h
  170.     4672    2436 47.8% 27-Mar-97 10:44:38 +samplePNM.datatype
  171.    12049    3015 74.9% 27-Mar-97 10:44:12 +libfuncs.c
  172.     3500    1914 45.3% 27-Mar-97 10:44:34 +libfuncs.o
  173.     4782    1435 69.9% 27-Mar-97 10:36:44 +LibInit.c
  174.     1476     812 44.9% 27-Mar-97 10:43:26 +LibInit.o
  175.     4672    2436 47.8% 27-Mar-97 10:44:36 +samplePNM.datatype
  176.      212     149 29.7% 27-Mar-97 10:44:44 +SCOPTIONS
  177.     4005    1206 69.8% 27-Mar-97 10:36:58 +StartUp.c
  178.      796     476 40.2% 27-Mar-97 10:43:24 +StartUp.o
  179.     6339    2508 60.4% 27-Mar-97 10:46:08 +README
  180.      803     453 43.5% 27-Mar-97 10:40:40 +Readme.SAS
  181. -------- ------- ----- --------- --------
  182.    47415   18965 60.0% 27-Mar-97 21:41:06   21 files
  183.